using System.Collections.Generic;
using UnityEngine;
using System;
using Map;

public static partial class Net
{
	/// <summary>
	/// 玩家登录
	/// </summary>
	public static void SendReqLoginMessage(String PlayerName)
	{
		Map.ReqLoginMessage msg = MessagePool.Instance.Fetch<Map.ReqLoginMessage>();
		msg.PlayerName = PlayerName;
		ClientNetManager.Send(msg);
		MessagePool.Instance.Recycle(msg);
	}
	/// <summary>
	/// 创建一个房间
	/// </summary>
	public static void SendReqCreateRoomMessage(String RoomName,String RoomPassword)
	{
		Map.ReqCreateRoomMessage msg = MessagePool.Instance.Fetch<Map.ReqCreateRoomMessage>();
		msg.RoomName = RoomName;
		msg.RoomPassword = RoomPassword;
		ClientNetManager.Send(msg);
		MessagePool.Instance.Recycle(msg);
	}
	/// <summary>
	/// 玩家创建角色
	/// </summary>
	public static void SendReqCreateRoleMessage(int RoleId)
	{
		Map.ReqCreateRoleMessage msg = MessagePool.Instance.Fetch<Map.ReqCreateRoleMessage>();
		msg.RoleId = RoleId;
		ClientNetManager.Send(msg);
		MessagePool.Instance.Recycle(msg);
	}
	/// <summary>
	/// 玩家登录房间
	/// </summary>
	public static void SendReqJoinRoomMapMessage(int RoomId)
	{
		Map.ReqJoinRoomMapMessage msg = MessagePool.Instance.Fetch<Map.ReqJoinRoomMapMessage>();
		msg.RoomId = RoomId;
		ClientNetManager.Send(msg);
		MessagePool.Instance.Recycle(msg);
	}
	/// <summary>
	/// 玩家请求离开房间
	/// </summary>
	public static void SendReqLeaveRoomMapMessage()
	{
		Map.ReqLeaveRoomMapMessage msg = MessagePool.Instance.Fetch<Map.ReqLeaveRoomMapMessage>();
		ClientNetManager.Send(msg);
		MessagePool.Instance.Recycle(msg);
	}
	/// <summary>
	/// 房间战斗准备好了，可以开始了
	/// </summary>
	public static void SendReqRoomBattleBeReadyMessage()
	{
		Map.ReqRoomBattleBeReadyMessage msg = MessagePool.Instance.Fetch<Map.ReqRoomBattleBeReadyMessage>();
		ClientNetManager.Send(msg);
		MessagePool.Instance.Recycle(msg);
	}
	/// <summary>
	/// 帧同步指令消息
	/// </summary>
	public static void SendReqLockStepCommandMessage(LockStepCommandBean Command)
	{
		Map.ReqLockStepCommandMessage msg = MessagePool.Instance.Fetch<Map.ReqLockStepCommandMessage>();
		msg.Command = Command;
		ClientNetManager.Send(msg);
		MessagePool.Instance.Recycle(msg);
	}
	/// <summary>
	/// 战斗结束
	/// </summary>
	public static void SendReqBattleEndMessage(int BattleState)
	{
		Map.ReqBattleEndMessage msg = MessagePool.Instance.Fetch<Map.ReqBattleEndMessage>();
		msg.BattleState = BattleState;
		ClientNetManager.Send(msg);
		MessagePool.Instance.Recycle(msg);
	}
}
